<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>题解——2021CCPC网络赛 | FZSF</title><meta name="keywords" content="CCPC"><meta name="author" content="FZSF"><meta name="copyright" content="FZSF"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="闲话学校只让28号返校，来不了就在家再待一周，所以只能上午赶去学校中午再run去学校，麻了+1。 由于假期期间作息不规律（ACMer必备）加上早上要去学校，出现了4点睡6点起的奇怪现象。 状态不好，感觉应该和上把CF一样炸裂。 开赛后果然如此，但是运气比较好，hduoj服务器生大病，比赛不作数，会重赛。 正篇 Problem A. Cut The WireInput file:">
<meta property="og:type" content="article">
<meta property="og:title" content="题解——2021CCPC网络赛">
<meta property="og:url" content="https://fanzsfu.gitee.io/2021/08/29/%E9%A2%98%E8%A7%A3-2021CCPC%E7%BD%91%E7%BB%9C%E8%B5%9B/index.html">
<meta property="og:site_name" content="FZSF">
<meta property="og:description" content="闲话学校只让28号返校，来不了就在家再待一周，所以只能上午赶去学校中午再run去学校，麻了+1。 由于假期期间作息不规律（ACMer必备）加上早上要去学校，出现了4点睡6点起的奇怪现象。 状态不好，感觉应该和上把CF一样炸裂。 开赛后果然如此，但是运气比较好，hduoj服务器生大病，比赛不作数，会重赛。 正篇 Problem A. Cut The WireInput file:">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://pic.imgdb.cn/item/612b4e5b44eaada7392ae20c.png">
<meta property="article:published_time" content="2021-08-29T07:05:09.000Z">
<meta property="article:modified_time" content="2021-08-31T12:54:45.502Z">
<meta property="article:author" content="FZSF">
<meta property="article:tag" content="CCPC">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic.imgdb.cn/item/612b4e5b44eaada7392ae20c.png"><link rel="shortcut icon" href="/img/tou.png"><link rel="canonical" href="https://fanzsfu.gitee.io/2021/08/29/%E9%A2%98%E8%A7%A3-2021CCPC%E7%BD%91%E7%BB%9C%E8%B5%9B/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '题解——2021CCPC网络赛',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-08-31 20:54:45'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://pic.imgdb.cn/item/6118dff15132923bf87690a5.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">20</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">5</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">5</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 清单</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://pic.imgdb.cn/item/612b4e5b44eaada7392ae20c.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">FZSF</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 清单</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">题解——2021CCPC网络赛</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-08-29T07:05:09.000Z" title="发表于 2021-08-29 15:05:09">2021-08-29</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-08-31T12:54:45.502Z" title="更新于 2021-08-31 20:54:45">2021-08-31</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E9%A2%98%E8%A7%A3/">题解</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>5分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="题解——2021CCPC网络赛"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="闲话"><a href="#闲话" class="headerlink" title="闲话"></a>闲话</h2><p>学校只让28号返校，来不了就在家再待一周，所以只能上午赶去学校中午再run去学校，麻了+1。</p>
<p>由于假期期间作息不规律<del>（ACMer必备）</del>加上早上要去学校，出现了4点睡6点起的奇怪现象。</p>
<p>状态不好，感觉应该和上把CF一样炸裂。</p>
<p>开赛后果然如此，但是运气比较好，hduoj服务器生大病，比赛不作数，会重赛。</p>
<h2 id="正篇"><a href="#正篇" class="headerlink" title="正篇"></a>正篇</h2><ul>
<li><h4 id="Problem-A-Cut-The-Wire"><a href="#Problem-A-Cut-The-Wire" class="headerlink" title="Problem A. Cut The Wire"></a>Problem A. Cut The Wire</h4><p>Input file:               standard input</p>
<p>Output file:            standard output</p>
<p>Time limit:             1 second</p>
<p>Memory limit:       256 megabytes</p>
<p>In the country of $Infinity$, there is a strange road. This road only has a starting point, but no end. Since this road is infinite, there are also countless street lights. The street lights are numbered from1(the starting point) to infinity. The street lights are connected by wires under a strange law:</p>
<p>For a street light $x$,</p>
<ul>
<li>if $x$ is even, then $x$ is connected with $\frac x2$ by a wire;</li>
<li>if $x$ is odd, then $x$ and $3x+ 1$ is connected by a wire.</li>
</ul>
<p>Now Kris is standing in the middle of street light $n$ and $n+ 1$, and he is able to cut all wires passing by.</p>
<p>That is, he will cut all wires connecting street lights $a$ and $b$ satisfying $a \leq n$ and $b &gt; n$.</p>
<p>Now he wonders, how many wires he will cut. Please help him calculate.</p>
<p><strong>Input</strong></p>
<p>This problem contains multiple test cases.</p>
<p>The first line contains an integer $T(1 \leq T \leq 10^5)$ indicating the number of test cases.</p>
<p>The next $T$ lines each contains one integer $n(1 \leq n \leq 10^9)$.</p>
<p><strong>Output</strong></p>
<p>For each test case, output one line of one integer indicating the answer.</p>
<p><strong>大体题意</strong></p>
<p>对于偶数$x$，他可以和$\frac x2$连接，对于奇数$x$，他可以和$3x+1$连接。</p>
<p>问在对于无限长的道路上，对于前$n$个数可以切断几条满足题目要求的线。</p>
<p><strong>解题思路</strong></p>
<p>定位是个签到题。</p>
<ul>
<li><p>对于大于$n$的偶数$x$，只要$\frac x2 \leq n$，就符合要求。</p>
</li>
<li><p>对于在$1$到$n$中的奇数$x$，只要$3x+1 &gt; n$，就符合要求。</p>
</li>
</ul>
<p><strong>AC代码</strong></p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;bits/stdc++.h&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="keyword">typedef</span> <span class="keyword">long</span> <span class="keyword">long</span> LL;</span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">int</span> t;</span><br><span class="line">    <span class="built_in">scanf</span>(<span class="string">&quot;%d&quot;</span>,&amp;t);</span><br><span class="line">    <span class="keyword">while</span>(t--)</span><br><span class="line">    &#123;</span><br><span class="line">        LL n;</span><br><span class="line">        <span class="built_in">scanf</span>(<span class="string">&quot;%lld&quot;</span>,&amp;n);</span><br><span class="line">        LL ans=<span class="number">0LL</span>;</span><br><span class="line">        ans+=n-n/<span class="number">2LL</span>;</span><br><span class="line">        LL x=n-(n<span class="number">-1LL</span>)/<span class="number">3LL</span>;</span><br><span class="line">        <span class="keyword">if</span>(x%<span class="number">2</span>==<span class="number">0</span>)</span><br><span class="line">        &#123;</span><br><span class="line">            ans+=x/<span class="number">2LL</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span></span><br><span class="line">        &#123;</span><br><span class="line">            <span class="keyword">if</span>(n%<span class="number">2</span>) ans+=x/<span class="number">2LL</span>+<span class="number">1LL</span>;</span><br><span class="line">            <span class="keyword">else</span> ans+=x/<span class="number">2LL</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;%lld\n&quot;</span>,ans);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><h4 id="Problem-F-Power-Sum"><a href="#Problem-F-Power-Sum" class="headerlink" title="Problem F. Power Sum"></a>Problem F. Power Sum</h4><p>Input file:               standard input</p>
<p>Output file:            standard output</p>
<p>Time limit:             1 second</p>
<p>Memory limit:       256 megabytes</p>
<p>Given a positive number $n$, Kris needs to find a positive number $k$ and an array ${a_i}(a_i \in {-1,1})$ of length $k(1 \leq k \leq n+ 2)$, such that:</p>
<script type="math/tex; mode=display">
\sum_{i=1}^k a_i\times i^2=n</script><p>This is too hard for Kris so you have to help him.</p>
<p><strong>Input</strong></p>
<p>The input contains multiple test cases.</p>
<p>The first line contains an integer $T(1 \leq T \leq 100)$ indicating the number of test cases.</p>
<p>Each of the next $T$ lines contains one integer $n(1 \leq n \leq 10^6)$.</p>
<p>It’s guaranteed that $\sum n \leq 3 ∗10^7$.</p>
<p><strong>Output</strong></p>
<p>The output should contain $2T$ lines. For each test case, output two lines.</p>
<p>The first line contains one integer,$k$.</p>
<p>The second line contains a 01-string of length $k$ representing the array, with0in the $i$th position denoting $a_i =−1$ and1denoting $a_i = 1$.</p>
<p>If there are multiple answers, print any.</p>
<p><strong>大体题意</strong></p>
<p>让我们来构造一个长度为$k$的数列$a$，其中的每个元素只能选择$1$或者$-1$。</p>
<p>要求对于这$k$个元素，要求$\sum_{i=1}^k a_i\times i^2=n$。</p>
<p><strong>解题思路</strong></p>
<p>很明显是个构造题。</p>
<p>对于前四个数，数列$a$选择：</p>
<ul>
<li>1 ：可以构造出1</li>
<li>0001 ：可以构造出2</li>
<li>01 ：可以构造出3</li>
<li>1001 ：可以构造出4</li>
</ul>
<p>又因为$(x+1)^2-(x+2)^2-(x+3)^2+(x+4)^2=4$</p>
<p>所以我们可以对$n$取模，通过上述构造来对应$n \mod 4$得数的所以情况。</p>
<p><strong>注：</strong>由于输出量巨大，所以采用类似std的输出方式会TLE，而采用字符串输出的方式会大大减少运行时间。</p>
<p><strong>AC代码</strong></p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;bits/stdc++.h&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">int</span> t;</span><br><span class="line">	<span class="built_in">scanf</span>(<span class="string">&quot;%d&quot;</span>,&amp;t);</span><br><span class="line">	<span class="keyword">while</span>(t--)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">int</span> n;</span><br><span class="line">		<span class="built_in">scanf</span>(<span class="string">&quot;%d&quot;</span>,&amp;n);</span><br><span class="line">		<span class="keyword">int</span> k=n/<span class="number">4</span>;</span><br><span class="line">		<span class="keyword">if</span>(n%<span class="number">4</span>==<span class="number">1</span>) <span class="built_in">printf</span>(<span class="string">&quot;%d\n1&quot;</span>,k*<span class="number">4</span>+<span class="number">1</span>);</span><br><span class="line">		<span class="keyword">else</span> <span class="keyword">if</span>(n%<span class="number">4</span>==<span class="number">2</span>) <span class="built_in">printf</span>(<span class="string">&quot;%d\n0001&quot;</span>,k*<span class="number">4</span>+<span class="number">4</span>);</span><br><span class="line">		<span class="keyword">else</span> <span class="keyword">if</span>(n%<span class="number">4</span>==<span class="number">3</span>) <span class="built_in">printf</span>(<span class="string">&quot;%d\n01&quot;</span>,k*<span class="number">4</span>+<span class="number">2</span>);</span><br><span class="line">		<span class="keyword">else</span> <span class="built_in">printf</span>(<span class="string">&quot;%d\n&quot;</span>,n);</span><br><span class="line">		<span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;k;i++) cout&lt;&lt;<span class="string">&quot;1001&quot;</span>;</span><br><span class="line">		<span class="built_in">puts</span>(<span class="string">&quot;&quot;</span>);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<hr>
<p><strong>未完待续</strong></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">FZSF</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://fanzsfu.gitee.io/2021/08/29/%E9%A2%98%E8%A7%A3-2021CCPC%E7%BD%91%E7%BB%9C%E8%B5%9B/">https://fanzsfu.gitee.io/2021/08/29/%E9%A2%98%E8%A7%A3-2021CCPC%E7%BD%91%E7%BB%9C%E8%B5%9B/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://fanzsfu.gitee.io" target="_blank">FZSF</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/CCPC/">CCPC</a></div><div class="post_share"><div class="social-share" data-image="https://pic.imgdb.cn/item/612b4e5b44eaada7392ae20c.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2021/09/01/%E7%AE%97%E6%B3%95%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%EF%BC%883%EF%BC%89%E2%80%94%E2%80%94%E5%B9%B6%E6%9F%A5%E9%9B%86/"><img class="prev-cover" src="https://pic.imgdb.cn/item/612f671944eaada739efe1f0.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">算法学习笔记(3)——并查集</div></div></a></div><div class="next-post pull-right"><a href="/2021/08/23/%E7%AE%97%E6%B3%95%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-2%E2%80%94%E2%80%94%E6%A0%91%E5%9E%8BDP/"><img class="next-cover" src="https://pic.imgdb.cn/item/6123b76844eaada739b8cba7.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">算法学习笔记(2)——树型DP</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://pic.imgdb.cn/item/6118dff15132923bf87690a5.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">FZSF</div><div class="author-info__description">记录与成长</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">20</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">5</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">5</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/Elbow-Leaf"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%97%B2%E8%AF%9D"><span class="toc-number">1.</span> <span class="toc-text">闲话</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%AD%A3%E7%AF%87"><span class="toc-number">2.</span> <span class="toc-text">正篇</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Problem-A-Cut-The-Wire"><span class="toc-number">2.0.1.</span> <span class="toc-text">Problem A. Cut The Wire</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Problem-F-Power-Sum"><span class="toc-number">2.0.2.</span> <span class="toc-text">Problem F. Power Sum</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/06/04/2022%E5%B9%B4%E5%B1%B1%E4%B8%9C%E7%9C%81ICPC%E7%9C%81%E8%B5%9B%E6%B8%B8%E8%AE%B0/" title="2022年山东省ICPC省赛游记"><img src="https://pic.imgdb.cn/item/629b123b09475431292426f7.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="2022年山东省ICPC省赛游记"/></a><div class="content"><a class="title" href="/2022/06/04/2022%E5%B9%B4%E5%B1%B1%E4%B8%9C%E7%9C%81ICPC%E7%9C%81%E8%B5%9B%E6%B8%B8%E8%AE%B0/" title="2022年山东省ICPC省赛游记">2022年山东省ICPC省赛游记</a><time datetime="2022-06-04T07:59:36.000Z" title="发表于 2022-06-04 15:59:36">2022-06-04</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/04/11/%E5%B1%B1%E4%B8%9C%E5%A4%9A%E6%A0%A1%E9%9B%86%E8%AE%AD1%E6%80%BB%E7%BB%93%EF%BC%88%E6%B5%81%E6%B0%B4%E8%B4%A6%EF%BC%89%E9%99%84%E4%B8%8D%E5%AE%8C%E5%85%A8%E9%A2%98%E8%A7%A3/" title="山东多校集训1总结（流水账）附不完全题解"><img src="https://pic.imgdb.cn/item/6253b949239250f7c54a1415.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="山东多校集训1总结（流水账）附不完全题解"/></a><div class="content"><a class="title" href="/2022/04/11/%E5%B1%B1%E4%B8%9C%E5%A4%9A%E6%A0%A1%E9%9B%86%E8%AE%AD1%E6%80%BB%E7%BB%93%EF%BC%88%E6%B5%81%E6%B0%B4%E8%B4%A6%EF%BC%89%E9%99%84%E4%B8%8D%E5%AE%8C%E5%85%A8%E9%A2%98%E8%A7%A3/" title="山东多校集训1总结（流水账）附不完全题解">山东多校集训1总结（流水账）附不完全题解</a><time datetime="2022-04-11T04:18:00.000Z" title="发表于 2022-04-11 12:18:00">2022-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/21/%E6%AF%8F%E6%97%A5%E4%B8%80DP-6-Leetcode-2172-%E7%8A%B6%E5%8E%8BDP/" title="每日一DP(6) Leetcode 2172(状压DP)"><img src="https://pic.imgdb.cn/item/6237ef7527f86abb2af1c508.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="每日一DP(6) Leetcode 2172(状压DP)"/></a><div class="content"><a class="title" href="/2022/03/21/%E6%AF%8F%E6%97%A5%E4%B8%80DP-6-Leetcode-2172-%E7%8A%B6%E5%8E%8BDP/" title="每日一DP(6) Leetcode 2172(状压DP)">每日一DP(6) Leetcode 2172(状压DP)</a><time datetime="2022-03-21T02:40:26.000Z" title="发表于 2022-03-21 10:40:26">2022-03-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/18/%E7%AE%97%E6%B3%95%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-8-%E2%80%94%E2%80%94%E8%83%8C%E5%8C%85DP/" title="算法学习笔记(8)——背包DP"><img src="https://pic.imgdb.cn/item/623403185baa1a80abe33090.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="算法学习笔记(8)——背包DP"/></a><div class="content"><a class="title" href="/2022/03/18/%E7%AE%97%E6%B3%95%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-8-%E2%80%94%E2%80%94%E8%83%8C%E5%8C%85DP/" title="算法学习笔记(8)——背包DP">算法学习笔记(8)——背包DP</a><time datetime="2022-03-18T00:58:52.000Z" title="发表于 2022-03-18 08:58:52">2022-03-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/01/13/%E6%AF%8F%E6%97%A5%E4%B8%80DP-5-CF1625C-%E7%BA%BF%E6%80%A7DP/" title="每日一DP(5) CF1625C (线性DP)"><img src="https://pic.imgdb.cn/item/61dffe022ab3f51d91788e88.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="每日一DP(5) CF1625C (线性DP)"/></a><div class="content"><a class="title" href="/2022/01/13/%E6%AF%8F%E6%97%A5%E4%B8%80DP-5-CF1625C-%E7%BA%BF%E6%80%A7DP/" title="每日一DP(5) CF1625C (线性DP)">每日一DP(5) CF1625C (线性DP)</a><time datetime="2022-01-13T10:03:53.000Z" title="发表于 2022-01-13 18:03:53">2022-01-13</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2021 - 2022 By FZSF</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    chtml: {
      scale: 1.2
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        insertScript: [200, () => {
          document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
            const target = node.parentNode
            if (target.nodeName.toLowerCase() === 'li') {
              target.parentNode.classList.add('has-jax')
            } else {
              target.classList.add('has-jax')
            }
          });
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>